4e6dddde38beb86cbfd0161a983889cbc0419bdf,android/src/test/java/com/thebluealliance/androidclient/notifications/CompLevelStartingNotificationTest.java,CompLevelStartingNotificationTest,testBuildNotification,#,88
Before Change
@Test
public void testBuildNotification() {
mNotification.parseMessageData();
Resources res = mock(Resources.class);
when(mContext.getResources()).thenReturn(res);
when(res.getString(R.string.finals_header)).thenReturn("Finals Matches");
when(res.getString(R.string.notification_level_starting_with_time, mNotification.getEventName(), "Finals Matches", "15:18:00"))
.thenReturn("Finals Matches are scheduled for 15:18:00");
when(res.getString(R.string.notification_level_starting_title, "HIHO", "Finals Matches"))
.thenReturn("HIHO Finals Matches Starting");
when(res.getString(R.string.notification_level_starting, mNotification.getEventName(), "Finals Matches"))
.thenReturn("Finals Matches starting");
Notification notification = mNotification.buildNotification(mContext, null);
After Change
StoredNotification stored = mNotification.getStoredNotification();
assertNotNull(stored);
assertEquals(NotificationTypes.LEVEL_STARTING, stored.getType());
assertEquals(mContext.getString(R.string.notification_level_starting_title, "HIHO", "Finals Matches"), stored.getTitle());
assertEquals(mContext.getString(R.string.notification_level_starting_with_time, mNotification.getEventName(), "Finals Matches", "15:18:00"), stored.getBody());
assertEquals(mData.toString(), stored.getMessageData());
assertEquals(MyTBAHelper.serializeIntent(mNotification.getIntent(mContext)), stored.getIntent());